Skip to content

copilot-core: Remove unused import from Test.Copilot.Core.Type. Refs #797. - #798

Merged
ivanperez-keera merged 2 commits into
Copilot-Language:masterfrom
ivanperez-keera:develop-fix-core-redundant-import
Nov 28, 2026
Merged

ivanperez-keera merged 2 commits into
Copilot-Language:masterfrom
ivanperez-keera:develop-fix-core-redundant-import

Conversation

@ivanperez-keera

@ivanperez-keera ivanperez-keera commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Remove an unused import from copilot-core:Test.Copilot.Core.Type, as prescribed in the solution proposed for #797.

…Copilot-Language#797.

The module `copilot-core:Test.Copilot.Core.Type` imports
`Data.Maybe.isJust`, but that function is not used anywhere in the
implementation. In compliance with our style guide, modules should not
contain any unused imports.

This commit removes the import of `Data.Maybe` from the module
`copilot-core:Test.Copilot.Core.Type`, since it is not used in the
module and is, therefore, not needed.
@ivanperez-keera

ivanperez-keera commented Nov 28, 2026 •

Copy link
Copy Markdown
Member Author

Change Manager: Verified that:

  • Solution is implemented:
    • The code proposed compiles and passes all tests. Details:
    • The solution proposed produces the expected result. Details:
      The following Dockerfile compiles copilot-core's tests instructing GHC to flag any unused imports as errors, after which it prints the message "Success":
      --- Dockerfile-verify-797
      FROM ubuntu:jammy
      
      WORKDIR /root
      SHELL ["/bin/bash", "-c"]
      
      ENV DEBIAN_FRONTEND=noninteractive
      RUN apt-get update
      
      RUN apt-get install --yes \
            bc \
            curl \
            g++ \
            gcc \
            git \
            libgmp3-dev  \
            libz-dev \
            make \
            pkg-config \
            z3
      
      RUN mkdir -p $HOME/.ghcup/bin
      RUN curl https://downloads.haskell.org/~ghcup/0.1.40.0/x86_64-linux-ghcup-0.1.40.0 -o $HOME/.ghcup/bin/ghcup
      RUN chmod a+x $HOME/.ghcup/bin/ghcup
      ENV PATH=$PATH:/root/.ghcup/bin/
      ENV PATH=$PATH:/root/.cabal/bin/
      
      RUN ghcup install ghc 9.10.1
      RUN ghcup install cabal 3.2
      RUN ghcup set ghc 9.10.1
      RUN cabal user-config init
      RUN sed -i -e "s;-- \(secure.\) True;\1 False;g" /root/.cabal/config
      RUN cabal update
      
      ARG GIT_COMMIT=HEAD
      ARG NAME=copilot
      ARG REPO=https://github.com/copilot-language/copilot
      
      RUN git clone ${REPO} ${NAME}
      RUN cd ${NAME} && git checkout ${GIT_COMMIT}
      
      WORKDIR ${NAME}
      
      RUN cabal v1-sandbox init
      RUN cabal v1-install alex happy
      RUN cabal v1-install copilot-core/ --enable-tests --only-dependencies
      RUN cabal v1-install copilot-core/ --enable-tests --ghc-option="-Werror=unused-imports"
      Command (substitute variables based on new path after merge):
      $ docker build --build-arg "REPO=https://github.com/ivanperez-keera/copilot" --build-arg "NAME=copilot" --build-arg "GIT_COMMIT=e5c735b534c6675f9a618ac1b15c509d8a127f84" -t copilot-verify-797 -f Dockerfile-verify-797 .
      
  • Implementation is documented. Details:
    No updates needed; change is to the imports in a test module.
  • Change history is clear.
  • Commit messages are clear.
  • Changelogs are updated.
  • Examples are updated. Details:
    No updates needed; change does not affect existing examples.
  • Author is internal or has provided signed CLA.
  • Required version bumps are evaluated. Details:
    Bump not needed; change does not affect public API.

@ivanperez-keera
ivanperez-keera merged commit ec2c437 into Copilot-Language:master Nov 28, 2026
12 checks passed
@ivanperez-keera
ivanperez-keera deleted the develop-fix-core-redundant-import branch November 28, 2026 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant